package mylib.archive.y2012.m08.CPR_Beta_1;

import mylib.dir.FastInputReader;
import mylib.dir.InputUtils;

import java.io.PrintWriter;

public class taskE {
    private int mod = 1000000000 + 7;

    public void solve(int testNumber, FastInputReader in, PrintWriter out) {
        int n = in.nextInt();
        int f = in.nextInt();
        int[] a = new int[n];
        InputUtils.inputArray(in, a);
        int[] count = new int[f + 1];
        count[0] = 1;
        for (int i = 0; i < n; ++i) {
            int[] next = count.clone();
            for (int paid = 0; paid <= f; ++paid) {
                next[Math.min(f, paid + a[i])] += count[paid];
                if (next[Math.min(f, paid + a[i])] >= mod)
                    next[Math.min(f, paid + a[i])] -= mod;
            }
            count = next;
        }
        out.println(count[f]);
    }
}
